<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app" style="width: 300px; height: 300px; border: solid 6px #e34334; overflow: auto">
        <div style="width: 1000px; height: 1000px; background: #833ca4"></div>
    </div>
    <script>
        const app = document.getElementById('app')
        app.addEventListener('scroll', function () {
            console.log(this.scrollLeft)
            console.log(this.scrollTop)
        })
    </script>
</body>
</html>